package com.Lixiaoqian.PartyHistoryMuseum.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;

/**
 * Created by HuangZhiBo on 2017/3/27/027.
 */

public class LoadImageUtils {
    /**
     * 加载m默认大小网络图片
     *
     * @param imgurl
     * @param imageView
     */
    public static void LoadImg(Context context, String imgurl, ImageView imageView) {
        try {
            Glide.with(context).load(imgurl)
                    .skipMemoryCache(true)
                    .diskCacheStrategy(DiskCacheStrategy.RESULT)
                    .into(imageView);
        } catch (Exception e) {

        }
    }

    /**
     * 加载网络图片
     *
     * @param imgurl
     * @param imageView
     */
    public static void LoadImg(Context context, String imgurl, ImageView imageView, int witdh, int height) {
        try {
            Glide.with(context).load(imgurl)
                    .override(witdh, height)
                    .skipMemoryCache(true)
                    .diskCacheStrategy(DiskCacheStrategy.RESULT)
                    .into(imageView);
        } catch (Exception e) {

        }


    }

}
